﻿

function all {
    $date= Get-Date 

    $formats = "d","D","f","F","g","G","m","r","s","t","T", "u","U","y","dddd, MMMM dd yyyy","M/yy","dd-MM-yy"
    Foreach ($format in $formats) {
        "PowerShell 日期格式, 使用 $format : {0}" -f $date.ToString($format) 
    }

    Get-Date -Format HH:mm:ss.fff 
}



function unixTime {
    # Unix纪元时间  # FROM:: http://cn.voidcc.com/question/p-xptfvmcu-rk.html
    Write-Host [Math]::Round((Get-Date).ToFileTime()/10000000 - 11644473600) 
}

function MicrosoftTime {
    # 以毫秒为定日期时间（微软划时代的时间）
    $date = Get-Date
    [Math]::Round(($date).ToFileTime()/10000) 
    Write-Host [Math]::Round(($date).ToFileTimeUTC()/10000) 
}


#all

#unixTime

# MicrosoftTime

Get-Date -Format "yyyy-MM-dd"






